package com.ruoyi.ums.service.impl;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ruoyi.ums.entity.MemberCoupon;
import com.ruoyi.ums.mapper.MemberCouponMapper;
import com.ruoyi.ums.service.IMemberCouponService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 用户优惠券 服务实现类
 * </p>
 *
 * @author kenny
 * @since 2021-11-04
 */
@Service
public class MemberCouponServiceImpl extends ServiceImpl<MemberCouponMapper, MemberCoupon> implements IMemberCouponService {


    public List<MemberCoupon> selectCoupons(Long memberId) {
        QueryWrapper<MemberCoupon> wrapper = new QueryWrapper<>();
        wrapper.lambda().eq(MemberCoupon::getMemberId,memberId);
        return this.baseMapper.selectList(wrapper);
    }
}
